package com.glut.forum.service;

import com.glut.forum.bean.dto.UserDTO;
import com.glut.forum.bean.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glut.forum.bean.vo.UserVO;
import com.glut.forum.common.beans.UserInfo;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author jobob
 * @since 2021-09-02
 */
public interface IUserService extends IService<User> {

    Map<String, Object> login(String account, String password);

    UserDTO getUserFormatToUserDTO(UserInfo userInfo);

    UserDTO getUserFormatToUserDTO(Integer id);

    UserVO getUserInfoById(Integer id);

    UserVO saveUser(User entity);

    UserVO updateUserInfo(UserVO uv);

    UserVO updateLoginUserInfo(UserVO uv, UserInfo userInfo);

    Boolean checkStatus(String value, String column);

    Boolean updatePwd(String password, UserInfo userInfo);

    Boolean authPwd(String password, UserInfo userInfo);

    Boolean emailCheck(String email);

    Boolean updatePwdByEmail(String password, String email, String vc);

    Boolean uploadAvatar(MultipartFile file, UserInfo userInfo);
}
